% author: Markus Scherer
% generates locical array describing rounded rectangle
% input:  r ... radius of rounded rectangle
% output: locical array describing rounded rectangle
function di = mimakecircle(r)
  d = 2*r +1;
  di = zeros(d, d);

  c = r+1;
  di(c,c) = 1;

  for i = 1:d
    for j = 1:d
      if( (c-i)^2 + (c-j)^2 <= (r+1)^2)
        di(i,j) = 1;
      end
    end
  end

  di = logical(di);
